#include "psd_modules.h"
#include "psd_logger.h"

int psd_event_logger_init();
int psd_event_logger_handler(const char *event_id, void *arg, const char *description);

static psdModule psd_event_logger_module = {
	.desc = "Event Display Utility",
	.dependencies = "",
	.init = psd_event_logger_init
};

psdModule *module_info() {
	return &psd_event_logger_module;
}

int psd_event_logger_init() {
	if (psd_event_register_listener("*", psd_event_logger_handler) != 0) {
		goto error_exit;
	}

	return 0;

error_exit:
	return -1;
}

int psd_event_logger_handler(const char *event_id, void *arg, const char *description) {
	psd_info(0, "Event: %s Description: %s", event_id, description);

	return 0;
}
